<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class User_model extends CI_Model {
    
    function User_model()
    {
        parent::__construct();
        //$this->CI =& get_instance();
    }
    
    function login($account)
    {
        $this->db->where($account);
        $result = $this->db->get('users');
        
        if($result->num_rows() > 0)
        {
            $user = $result->row_array();
            return $user['id'];
        }
        else
        {
            return 0;
        }
    }
    
    function user_details($user_id)
    {
        $this->db->where('id', $user_id);
        return $this->db->get('users');
    }
    
}

/* End of file user_model.php */
/* Location: ./application/models/user_model.php */